package cn.luke.basic.services;

import cn.luke.basic.entity.DtoPayHistory;
import cn.luke.basic.entity.DtoTemplateCampus;
import org.springframework.stereotype.Service;

import java.util.Map;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;


import cn.luke.basic.mapper.MapperPayHistory;
import org.springframework.transaction.annotation.Transactional;


@Service
public class ServicePayHistory extends ServiceImpl<MapperPayHistory, DtoPayHistory> implements BaseService<DtoPayHistory> {

    @Override
    public LambdaQueryWrapper<DtoPayHistory> fillParams(Map<String, Object> params) {
        LambdaQueryWrapper<DtoPayHistory> qw = loadQw();
        return qw;
    }


    /**
     * 根据模板id查询
     */
    @Transactional
    public long countByTemplateId(Integer templateId) {
        final LambdaQueryWrapper<DtoPayHistory> wrapper = loadQw();
        wrapper.eq(DtoPayHistory::getTemplateId, templateId);
        return count(wrapper);
    }
}